package com.metaera.app.controller.presenter;

import com.metaera.app.controller.core.SimplePaginationPresenter;
import com.metaera.app.data.DataRepository;
import com.metaera.app.data.model.ArticleListResponse;
import com.metaera.app.data.model.BasicListResponse;
import com.metaera.app.data.network.ApiParam;

import io.reactivex.Observable;

/**
 * 首页新闻
 */
public class HomeNewsListPresenter extends SimplePaginationPresenter<ArticleListResponse> {

    private final int mCategoryID;

    public HomeNewsListPresenter(int categoryID) {
        mCategoryID = categoryID;
    }

    @Override
    protected Observable<BasicListResponse<ArticleListResponse>> execute() {
        return DataRepository.getInstance()
                .getArticleList(mCategoryID, ApiParam.GET_ARTICLE_LIST_HOME_TYPE, mPage, ApiParam.PAGE_SIZE);
    }

}
